package casia.isiteam.springbootshiro.properties.result;


import casia.isiteam.springbootshiro.properties.other.HttpState;

/**
 * Author wzy
 * Date 2017/7/31 21:37
 */
public class HttpResult {
    public static Result sucess( Object data ){
        Result result = new Result();
        result.setCode( HttpState.SUCCESS.code());
        result.setMsg( HttpState.SUCCESS.annotation() );
        result.setData(data);
        return result;
    }
    public static Result sucess(){
        return sucess(null);
    }
    public static Result error (Integer code,String msg){
        Result result = new Result();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }
    public static Result error (Integer code,String msg,String data){
        Result result = new Result();
        result.setCode(code);
        result.setMsg(msg);
        result.setData(data);
        return result;
    }
}
